# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2023/4/24 11:27
# @Author : xyjiang1216
# @Email : jiangxuyan@nudt.edu.cn
# @File : layer_7_verify_solution.py
# @Version: OpenPlanner2.0
from OpenPlanner.core.src.op_class import OPClass


class SolutionVerifyingModule:
    def __init__(self,
                 op_obj: OPClass):
        self.op_obj = op_obj

    def _verify_solution_using_smt(self):
        pass

    def _deduce_solution(self):
        pass

    def verify_solution(self):
        option = self.op_obj.solution_verification_option

        # 判断解是否已经做转换
        if option != 'NONE' and \
                self.op_obj.solution_transformation_option == 'NONE':
            print('ERROR: 解未做转换，'
                  '无法使用验证模块('
                  'solution_verification_option'
                  '只能置为NONE)，'
                  '请更新配置文件')
            exit(0)

        if option == 'SMT':
            self._verify_solution_using_smt()
        elif option == 'DEDUCE':
            self._deduce_solution()
        elif option == 'NONE':
            pass
        else:
            print('ERROR: 不存在的'
                  'solution_verification_option：%s，'
                  '只能从SMT、DEDUCE和NONE中选取'
                  % option)
            exit(0)
